<!-- UtilsComponent.vue -->
<template>
  <!-- 这个组件主要用于提供数据，可以不渲染任何内容 -->
  <div v-if="false"></div>
</template>

<script>
export default {
  name: "UtilsComponent",
  props: {
    functionName: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      data: null,
    };
  },
  created() {
    this.getData();
  },
  methods: {
    analysisMyValue(json, jsonString) {
      try {
        var str = "|" + jsonString + "|:";
        json = json.split(str);
        json = json[1];
        json = json.split("'");
        var resp = json[1];
        return resp;
      } catch (e) {
        return "";
      }
    },
    changeVehicleLocus() {
      return [
        { value: "420000", label: "湖北省" },
        { value: "420100", label: "武汉市" },
        { value: "420200", label: "黄石市" },
        { value: "420300", label: "十堰市" },
        { value: "420500", label: "宜昌市" },
        { value: "420600", label: "襄阳市" },
        { value: "420700", label: "鄂州市" },
        { value: "420800", label: "荆门市" },
        { value: "420900", label: "孝感市" },
        { value: "421000", label: "荆州市" },
        { value: "421100", label: "黄冈市" },
        { value: "421200", label: "咸宁市" },
        { value: "421300", label: "随州市" },
        { value: "422800", label: "恩施州" },
        { value: "429004", label: "仙桃市" },
        { value: "429005", label: "潜江市" },
        { value: "429006", label: "天门市" },
        { value: "429021", label: "神农架林区" },
      ];
    },
    pronameChangecode() {
      return [
        { value: "", label: "全国" },
        { value: "110000", label: "北京市" },
        { value: "120000", label: "天津市" },
        { value: "130000", label: "河北省" },
        { value: "140000", label: "山西省" },
        { value: "150000", label: "内蒙古自治区" },
        { value: "210000", label: "辽宁省" },
        { value: "220000", label: "吉林省" },
        { value: "230000", label: "黑龙江省" },
        { value: "310000", label: "上海市" },
        { value: "320000", label: "江苏省" },
        { value: "330000", label: "浙江省" },
        { value: "340000", label: "安徽省" },
        { value: "350000", label: "福建省" },
        { value: "360000", label: "江西省" },
        { value: "370000", label: "山东省" },
        { value: "410000", label: "河南省" },
        { value: "420000", label: "湖北省" },
        { value: "430000", label: "湖南省" },
        { value: "440000", label: "广东省" },
        { value: "450000", label: "广西壮族自治区" },
        { value: "460000", label: "海南省" },
        { value: "500000", label: "重庆市" },
        { value: "510000", label: "四川省" },
        { value: "520000", label: "贵州省" },
        { value: "530000", label: "云南省" },
        { value: "540000", label: "西藏自治区" },
        { value: "610000", label: "陕西省" },
        { value: "620000", label: "甘肃省" },
        { value: "630000", label: "青海省" },
        { value: "640000", label: "宁夏回族自治区" },
        { value: "650000", label: "新疆维吾尔自治区" },
      ];
    },
    procodeChangename() {
      return [
        { value: "", label: "全国" },
        { value: "110000", label: "北京市" },
        { value: "120000", label: "天津市" },
        { value: "130000", label: "河北省" },
        { value: "140000", label: "山西省" },
        { value: "150000", label: "内蒙古自治区" },
        { value: "210000", label: "辽宁省" },
        { value: "220000", label: "吉林省" },
        { value: "230000", label: "黑龙江省" },
        { value: "310000", label: "上海市" },
        { value: "320000", label: "江苏省" },
        { value: "330000", label: "浙江省" },
        { value: "340000", label: "安徽省" },
        { value: "350000", label: "福建省" },
        { value: "360000", label: "江西省" },
        { value: "370000", label: "山东省" },
        { value: "410000", label: "河南省" },
        { value: "420000", label: "湖北省" },
        { value: "430000", label: "湖南省" },
        { value: "440000", label: "广东省" },
        { value: "450000", label: "广西壮族自治区" },
        { value: "460000", label: "海南省" },
        { value: "500000", label: "重庆市" },
        { value: "510000", label: "四川省" },
        { value: "520000", label: "贵州省" },
        { value: "530000", label: "云南省" },
        { value: "540000", label: "西藏自治区" },
        { value: "610000", label: "陕西省" },
        { value: "620000", label: "甘肃省" },
        { value: "630000", label: "青海省" },
        { value: "640000", label: "宁夏回族自治区" },
        { value: "650000", label: "新疆维吾尔自治区" },
      ];
    },
    pronameChangeVehi() {
      return [
        { value: "", label: "全国" },
        { value: "京", label: "北京市" },
        { value: "津", label: "天津市" },
        { value: "冀", label: "河北省" },
        { value: "晋", label: "山西省" },
        { value: "蒙", label: "内蒙古自治区" },
        { value: "辽", label: "辽宁省" },
        { value: "吉", label: "吉林省" },
        { value: "黑", label: "黑龙江省" },
        { value: "沪", label: "上海市" },
        { value: "苏", label: "江苏省" },
        { value: "浙", label: "浙江省" },
        { value: "皖", label: "安徽省" },
        { value: "闽", label: "福建省" },
        { value: "赣", label: "江西省" },
        { value: "鲁", label: "山东省" },
        { value: "豫", label: "河南省" },
        { value: "鄂", label: "湖北省" },
        { value: "湘", label: "湖南省" },
        { value: "粤", label: "广东省" },
        { value: "桂", label: "广西壮族自治区" },
        { value: "琼", label: "海南省" },
        { value: "渝", label: "重庆市" },
        { value: "川", label: "四川省" },
        { value: "贵", label: "贵州省" },
        { value: "云", label: "云南省" },
        { value: "藏", label: "西藏自治区" },
        { value: "陕", label: "陕西省" },
        { value: "甘", label: "甘肃省" },
        { value: "青", label: "青海省" },
        { value: "宁", label: "宁夏回族自治区" },
        { value: "新", label: "新疆维吾尔自治区" },
      ];
    },
    vehiChangeProname() {
      return [
        { value: "", label: "全国" },
        { value: "京", label: "北京市" },
        { value: "津", label: "天津市" },
        { value: "冀", label: "河北省" },
        { value: "晋", label: "山西省" },
        { value: "蒙", label: "内蒙古自治区" },
        { value: "辽", label: "辽宁省" },
        { value: "吉", label: "吉林省" },
        { value: "黑", label: "黑龙江省" },
        { value: "沪", label: "上海市" },
        { value: "苏", label: "江苏省" },
        { value: "浙", label: "浙江省" },
        { value: "皖", label: "安徽省" },
        { value: "闽", label: "福建省" },
        { value: "赣", label: "江西省" },
        { value: "鲁", label: "山东省" },
        { value: "豫", label: "河南省" },
        { value: "鄂", label: "湖北省" },
        { value: "湘", label: "湖南省" },
        { value: "粤", label: "广东省" },
        { value: "桂", label: "广西壮族自治区" },
        { value: "琼", label: "海南省" },
        { value: "渝", label: "重庆市" },
        { value: "川", label: "四川省" },
        { value: "贵", label: "贵州省" },
        { value: "云", label: "云南省" },
        { value: "藏", label: "西藏自治区" },
        { value: "陕", label: "陕西省" },
        { value: "甘", label: "甘肃省" },
        { value: "青", label: "青海省" },
        { value: "宁", label: "宁夏回族自治区" },
        { value: "新", label: "新疆维吾尔自治区" },
      ];
    },
    changeOperstate() {
      return [
        { value: "10", label: "营运" },
        { value: "21", label: "停运" },
        { value: "22", label: "挂失" },
        { value: "31", label: "迁出-过户" },
        { value: "32", label: "迁出-转籍" },
        { value: "33", label: "报废" },
        { value: "34", label: "歇业" },
        { value: "80", label: "注销" },
        { value: "90", label: "其他" },
      ];
    },
    changeOperowner() {
      return [
        { value: "1", label: "营业" },
        { value: "2", label: "停业" },
        { value: "3", label: "整改" },
        { value: "4", label: "停业整顿" },
        { value: "5", label: "歇业" },
        { value: "6", label: "注销" },
        { value: "9", label: "其他" },
      ];
    },
    changePlatecolor() {
      return [
        { value: "1", label: "蓝色" },
        { value: "2", label: "黄色" },
        { value: "3", label: "黑色" },
        { value: "4", label: "白色" },
        { value: "5", label: "绿色" },
        { value: "9", label: "其他" },
      ];
    },
    changePlatecolorCode() {
      return [
        { value: "1", label: "蓝色" },
        { value: "2", label: "黄色" },
        { value: "3", label: "黑色" },
        { value: "4", label: "白色" },
        { value: "5", label: "绿色" },
        { value: "9", label: "其他" },
      ];
    },
    changeTrans() {
      return [
        { value: 10, label: "道路旅客运输" },
        { value: 20, label: "道路普通货物运输" },
        { value: 30, label: "道路危险货物运输" },
        { value: 40, label: "机动车维修" },
        { value: 50, label: "机动车驾驶员培训(教练车)" },
        { value: 61, label: "道路客运站" },
        { value: 62, label: "道路货运站" },
        { value: 70, label: "国际道路运输" },
        { value: 80, label: "公交运输" },
        { value: 90, label: "出租运输" },
        { value: 93, label: "客运网约出租运输" },
        { value: 100, label: "汽车租赁" },
        { value: 110, label: "机动车综合性能检测" },
        { value: 120, label: "道路货运辅助" },
      ];
    },
    changeVehType() {
      return [
        { value: 12, label: "中型客车" },
        { value: 13, label: "小型客车" },
        { value: 20, label: "普通货车" },
        { value: 21, label: "大型普通客车" },
        { value: 22, label: "中型普通货车" },
        { value: 23, label: "小型普通货车" },
        { value: 30, label: "专用运输车" },
        { value: 31, label: "集装箱车" },
        { value: 32, label: "大件运输车" },
        { value: 33, label: "保湿冷藏车" },
        { value: 34, label: "商品车运输专用车辆" },
        { value: 35, label: "罐车" },
        { value: 36, label: "牵引车" },
        { value: 37, label: "挂车" },
        { value: 38, label: "平板车" },
        { value: 39, label: "其他专用车" },
        { value: 40, label: "危险品运输车" },
        { value: 50, label: "农用车" },
        { value: 60, label: "拖拉机" },
        { value: 90, label: "其他车辆" },
      ];
    },
    getFueltype() {
      return [
        { value: 1, label: "汽油" },
        { value: 2, label: "柴油" },
        { value: 3, label: "天然气" },
        { value: 4, label: "液化气" },
        { value: 5, label: "电动" },
        { value: 9, label: "电动" },
      ];
    },
    lockmode() {
      return [
        { value: 0, label: "未解锁" },
        { value: 1, label: "已处罚" },
        { value: 2, label: "人工" },
      ];
    },
    isEntry() {
      return [
        { value: 0, label: "否" },
        { value: 1, label: "是" },
      ];
    },
    vehiuse() {
      return [
        { value: 1, label: "经营性" },
        { value: 2, label: "非经营性" },
      ];
    },
    certstype() {
      return [
        { value: 1, label: "纸质" },
        { value: 2, label: "电子" },
        { value: 3, label: "其他" },
      ];
    },
    certstatus() {
      return [
        { value: 1, label: "有效" },
        { value: 2, label: "无效" },
      ];
    },
    ownercerttype() {
      return [
        { value: 1, label: "道路经营许可证" },
        { value: 2, label: "道路辅助经营许可证" },
      ];
    },
    getPracCertType() {
      return [
        { value: 1, label: "道路运输从业证件" },
        { value: 2, label: "教练员证件" },
        { value: 3, label: "出租车驾驶员" },
      ];
    },
    getPracPersonnelType() {
      return [
        { value: 1, label: "普通从业人员" },
        { value: 2, label: "出租车驾驶员" },
        { value: 3, label: "教练员" },
      ];
    },
    getWorkType() {
      return [
        { value: "01001", label: "客运驾驶员" },
        { value: "02001", label: "货运驾驶员" },
        { value: "03001", label: "危货驾驶员" },
        { value: "03002", label: "危货装卸员" },
        { value: "03003", label: "危货押运员" },
        { value: "03004", label: "危货安全员" },
        { value: "03005", label: "剧毒品驾驶员" },
        { value: "03006", label: "剧毒品装卸员" },
        { value: "03007", label: "剧毒品押运员" },
        { value: "03008", label: "剧毒品安全员" },
        { value: "03009", label: "爆炸品驾驶员" },
        { value: "03010", label: "爆炸品装卸员" },
        { value: "03011", label: "爆炸品押运员" },
        { value: "03012", label: "爆炸品安全员" },
        { value: "03013", label: "放射品驾驶员" },
        { value: "03014", label: "放射品装卸员" },
        { value: "03015", label: "放射品押运员" },
        { value: "03016", label: "放射品安全员" },
        { value: "04001", label: "维修•技术负责" },
        { value: "04002", label: "维修•质检" },
        { value: "04003", label: "维修•机修" },
        { value: "04004", label: "维修•电器" },
        { value: "04005", label: "维修•钣金" },
        { value: "04006", label: "维修•涂漆" },
        { value: "04007", label: "维修•技术评估" },
        { value: "05001", label: "理论教练员" },
        { value: "05002", label: "操作教练员" },
        { value: "05003", label: "客货教练员" },
        { value: "05005", label: "危货教练员" },
        { value: "05006", label: "放射品教练员" },
        { value: "05007", label: "残疾人教练员" },
        { value: "09001", label: "出租车驾驶员" },
        { value: "11001", label: "客运经理人" },
        { value: "11002", label: "货运经理人" },
        { value: "11003", label: "维修经理人" },
        { value: "11004", label: "驾培经理人" },
        { value: "12001", label: "租赁业务员" },
        { value: "12002", label: "客运乘务员" },
        { value: "12008", label: "驾培负责人" },
        { value: "12009", label: "驾培考核员" },
        { value: "12010", label: "维修结算员" },
        { value: "12011", label: "维修接待员" },
        { value: "13001", label: "公交驾驶员" },
        { value: "14001", label: "轨道驾驶员" },
        { value: "14002", label: "轨道调度员" },
        { value: "14003", label: "轨道值班员" },
      ];
    },
    getPracState() {
      return [
        { value: 1, label: "从业" },
        { value: 2, label: "待业" },
        { value: 9, label: "注销" },
        { value: 10, label: "吊销" },
        { value: 11, label: "撤销" },
      ];
    },
    getPracSource() {
      return [
        { value: 0, label: "本籍从业人员" },
        { value: 1, label: "外籍从业人员" },
        { value: 2, label: "非从业人员" },
      ];
    },
    getPracStatus() {
      return [
        { value: 1, label: "正常" },
        { value: 2, label: "任务中" },
      ];
    },
    getSex() {
      return [
        { value: 1, label: "男" },
        { value: 2, label: "女" },
      ];
    },
    getCreditStatus() {
      return [
        { value: 0, label: "进行中" },
        { value: 1, label: "已完成" },
        { value: 2, label: "未完成" },
        { value: 9, label: "无效" },
      ];
    },
    getCreditLevel() {
      return [
        { value: 0, label: "未考核" },
        { value: 1, label: "优良(AAA级)" },
        { value: 2, label: "合格(AA级)" },
        { value: 3, label: "基本合格(A级)" },
        { value: 4, label: "不合格(B级)" },
      ];
    },
    vehiTechnologyLevel() {
      return [
        { value: 0, label: "未评定" },
        { value: 1, label: "一级" },
        { value: 2, label: "二级" },
        { value: 3, label: "三级" },
        { value: 9, label: "未达标" },
      ];
    },
    vehiInspectState() {
      return [
        { value: 0, label: "未评定" },
        { value: 1, label: "已评定" },
        { value: 2, label: "历史" },
        { value: 9, label: "无效" },
      ];
    },
    vehiTechnologyState() {
      return [
        { value: 0, label: "未审验" },
        { value: 1, label: "进行中" },
        { value: 2, label: "已审验" },
        { value: 9, label: "无效" },
      ];
    },
    vehiTechnologyres() {
      return [
        { value: 1, label: "合格" },
        { value: 2, label: "不合格" },
        { value: 3, label: "已审验" },
        { value: 9, label: "无效" },
      ];
    },
    changeCertType() {
      return [
        { value: 1, label: "身份证" },
        { value: 2, label: "军官证" },
        { value: 3, label: "警官证" },
        { value: 4, label: "外国护照" },
        { value: 5, label: "港澳台居民证" },
        { value: 9, label: "其他" },
      ];
    },
    changeLisenseType() {
      return [
        { value: 1, label: "身份证" },
        { value: 2, label: "驾驶证" },
        { value: 3, label: "从业资格证" },
        { value: 9, label: "其他证件" },
      ];
    },
    getEducation() {
      return [
        { value: 10, label: "研究生" },
        { value: 20, label: "本科" },
        { value: 30, label: "大专" },
        { value: 40, label: "中专技校" },
        { value: 60, label: "高中" },
        { value: 70, label: "初中" },
        { value: 80, label: "小学" },
        { value: 90, label: "其他" },
      ];
    },
    changeDetectType() {
      return [
        { value: 1, label: "等级评定" },
        { value: 2, label: "春运检测" },
      ];
    },
    changeDsType() {
      return [
        { value: 1, label: "国有企业" },
        { value: 2, label: "民营企业" },
        { value: 3, label: "有限公司" },
        { value: 4, label: "有限责任公司" },
        { value: 5, label: "股份有限公司" },
        { value: 6, label: "集体" },
        { value: 7, label: "其他" },
      ];
    },
    getEvidenceType() {
      return [
        { value: 1, label: "书证" },
        { value: 2, label: "物证" },
        { value: 3, label: "视听材料" },
        { value: 4, label: "当事人陈述" },
        { value: 5, label: "证人证言" },
        { value: 6, label: "现场笔录" },
        { value: 7, label: "电子数据" },
        { value: 9, label: "其他" },
      ];
    },
    subStr(str) {
      if (str == null) {
        return "";
      }
      if (str.length < 10) {
        return str;
      }
      return str.substr(0, 9) + "...";
    },
    subymd(datetime) {
      return datetime.substr(0, 10);
    },
    changeEconomicType() {
      return [
        { value: "100", label: "内资" },
        { value: "110", label: "国有全资" },
        { value: "120", label: "集体全资" },
        { value: "130", label: "股份合作" },
        { value: "140", label: "联营" },
        { value: "141", label: "国有联营" },
        { value: "142", label: "集体联营" },
        { value: "143", label: "国有与集体联营" },
        { value: "149", label: "其他联营" },
        { value: "150", label: "有限责任（公司）" },
        { value: "151", label: "国有独资（公司）" },
        { value: "159", label: "其他有限责任（公司）" },
        { value: "160", label: "股份有限（公司）" },
        { value: "170", label: "私有" },
        { value: "171", label: "私有独资" },
        { value: "172", label: "私有合伙" },
        { value: "173", label: "私营有限责任(公司)" },
        { value: "174", label: "私营股份有限(公司)" },
        { value: "175", label: "个体经营" },
        { value: "179", label: "其他私有" },
        { value: "190", label: "其他内资" },
        { value: "200", label: "港、澳、台投资" },
        { value: "210", label: "内地和港、澳、台合资" },
        { value: "220", label: "内地和港、澳、台合作" },
        { value: "230", label: "港、澳、台独资" },
        { value: "240", label: "港、澳、台投资股份有限(公司)" },
        { value: "290", label: "其他港、澳、台投资" },
        { value: "300", label: "国外投资" },
        { value: "310", label: "中外合资" },
        { value: "320", label: "中外合作" },
        { value: "330", label: "外资" },
        { value: "340", label: "国外投资股份有限(公司)" },
        { value: "390", label: "其他国外投资" },
        { value: "900", label: "其他" },
      ];
    },
    getNationality() {
      return [
        { value: "01", label: "汉族" },
        { value: "02", label: "蒙古族" },
        { value: "03", label: "回族" },
        { value: "04", label: "藏族" },
        { value: "05", label: "维吾尔族" },
        { value: "06", label: "苗族" },
        { value: "07", label: "彝族" },
        { value: "08", label: "壮族" },
        { value: "09", label: "布依族" },
        { value: "10", label: "朝鲜族" },
        { value: "11", label: "满族" },
        { value: "12", label: "侗族" },
        { value: "13", label: "瑶族" },
        { value: "14", label: "白族" },
        { value: "15", label: "土家族" },
        { value: "16", label: "哈尼族" },
        { value: "17", label: "哈萨克族" },
        { value: "18", label: "傣族" },
        { value: "19", label: "黎族" },
        { value: "20", label: "僳僳族" },
        { value: "21", label: "佤族" },
        { value: "22", label: "畲族" },
        { value: "23", label: "高山族" },
        { value: "24", label: "拉祜族" },
        { value: "25", label: "水族" },
        { value: "26", label: "东乡族" },
        { value: "27", label: "纳西族" },
        { value: "28", label: "景颇族" },
        { value: "29", label: "柯尔克孜族" },
        { value: "30", label: "土族" },
        { value: "31", label: "达翰尔族" },
        { value: "32", label: "仫佬族" },
        { value: "33", label: "羌族" },
        { value: "34", label: "布朗族" },
        { value: "35", label: "撒拉族" },
        { value: "36", label: "毛南族" },
        { value: "37", label: "仡佬族" },
        { value: "38", label: "锡伯族" },
        { value: "39", label: "阿昌族" },
        { value: "40", label: "普米族" },
        { value: "41", label: "塔吉克族" },
        { value: "42", label: "怒族" },
        { value: "43", label: "乌孜别克族" },
        { value: "44", label: "俄罗斯族" },
        { value: "45", label: "鄂温克族" },
        { value: "46", label: "德昂族" },
        { value: "47", label: "保安族" },
        { value: "48", label: "裕固族" },
        { value: "49", label: "京族" },
        { value: "50", label: "塔塔尔族" },
        { value: "51", label: "独龙族" },
        { value: "52", label: "鄂伦春族" },
        { value: "53", label: "郝哲族" },
        { value: "54", label: "门巴族" },
        { value: "55", label: "珞巴族" },
        { value: "56", label: "基诺族" },
        { value: "97", label: "其他" },
        { value: "98", label: "外国血统中国籍人士" },
      ];
    },
    getApplyTypeName() {
      return [
        { value: 0, label: "旅游" },
        { value: 1, label: "非旅游" },
      ];
    },
    getRecordStateName() {
      return [
        { value: 1, label: "已提交" },
        { value: 2, label: "已生效" },
        { value: 3, label: "已完成" },
        { value: 4, label: "已撤销" },
        { value: 5, label: "已作废" },
      ];
    },
    getApprovalStateName() {
      return [
        { value: 1, label: "待审批" },
        { value: 2, label: "通过" },
        { value: 3, label: "不通过" },
      ];
    },
    getSignsTypeName() {
      return [
        { value: "01204", label: "省际包车" },
        { value: "01203", label: "市际包车" },
        { value: "01202", label: "县际包车" },
      ];
    },
    getWhetherOrNot() {
      return [
        { value: 0, label: "否" },
        { value: 1, label: "是" },
        { value: 2, label: "否" },
      ];
    },
    getGPSResult() {
      return [
        { value: 0, label: "GPS比对未进行" },
        { value: 1, label: "GPS比对合格" },
        { value: 2, label: "GPS比对不合格" },
        { value: 3, label: "GPS比对失败" },
        { value: 4, label: "获取数据异常" },
      ];
    },
    toJSON(object, max) {
      if (max == null) max = Number.POSITIVE_INFINITY;
      var f = function (obj, num) {
        if (typeof obj == "string") return '"' + obj + '"';
        if (typeof obj == "number") return obj + "";
        if (typeof obj == "boolean") return obj + "";
        if (typeof obj == "function") return "function";
        if (typeof obj == "undefined") return "undefined";
        if (obj == null) return "null";
        if (num > max) {
          if (Array.isArray(obj)) return "array";
          return "object";
        }
        var s1 = "",
          s2 = "";
        for (var i = 1; i < num; i++) s1 = s1 + "\t";
        s2 = s1 + "\t";
        var str = "";

        if (Array.isArray(obj)) {
          str = "[";
          for (var key in obj)
            str = str + "\n" + s2 + f(obj[key], num + 1) + ",";
          str = str.substring(0, str.length - 1) + "\n" + s1 + "]";
        } else {
          str = "{";
          for (var key in obj)
            str = str + "\n" + s2 + key + ":" + f(obj[key], num + 1) + ",";
          str = str.substring(0, str.length - 1) + "\n" + s1 + "}";
        }
        return str;
      };
      return f(object, 1);
    },
    showMsg({
      title = "提示", //标题
      content, //内容
      buttonContent = "确认", //按钮内容
      clickClose = false, //点击背景时，是否关闭弹窗
    }) {
      var html = `
        <div style="width:100%;height: 100%;position: absolute;background-color: rgba(0,0,0,0.5);font-size: 16px;color:#808080;top:0px;left:0px;" class="__showMsg">
            <div style="width:calc(100% - 60px);position: absolute;background-color: #FFFFFF;left:30px;top:50%;transform: translateY(-50%);">
                <div style="margin:15px 0 15px 15px;width:calc(100% - 30px);color:#87CEFA;font-size: 22px;">${title}</div>
                <div style="margin-left:10px;width:calc(100% - 20px);border-top:solid 1px #CCCCCC;"></div>
                <div style="margin:15px 0 35px 15px;width:calc(100% - 30px)">${content}</div>
                <div style="margin:15px 0 15px 15px;width:calc(100% - 32px);text-align: center;line-height: 40px;height:40px;border: solid 1px #CCCCCC;">${buttonContent}</div>
            </div>
        </div>
    `;

      console.log(html);

      var close = function (event) {
        event.stopPropagation();
        var body = document.querySelector("body");
        var msgEle = document.querySelector(".__showMsg");
        body.removeChild(msgEle);
      };

      var body = document.querySelector("body");
      body.innerHTML = body.innerHTML + html;

      document.querySelector(".__showMsg>div>div:nth-child(4)").onclick = close;
      document.querySelector(".__showMsg>div").onclick = function (event) {
        event.stopPropagation();
      };
      if (clickClose) {
        document.querySelector(".__showMsg").onclick = close;
      }
    },
    showList({
      list = [], //一个数组，元素必须是个html字符串
      onclick, //function(event,index){}
    }) {
      var html = `
        <div style="width:100%;height: 110%;position: absolute;background-color: rgba(0,0,0,0.5);font-size: 16px;color:#808080;top:0px;left:0px;" class="__showList">
            <ul style="width:calc(100%);position: absolute;top:50%;transform: translateY(-50%);list-style-type: none;">
                ${list
                  .map((value, index) => {
                    return `<li style="position: relative;width:100%;" index="${index}"> ${value}</li>`;
                  })
                  .toString()
                  .replace(/,/g, "")}
            </ul>
        </div>
    `;

      var body = document.querySelector("body");
      body.innerHTML = body.innerHTML + html;

      if (typeof onclick === "function") {
        document.querySelector(".__showList>ul").onclick = function (event) {
          event.stopPropagation();
          var ele = event.target;
          while (ele != null && ele.tagName !== "LI") {
            ele = ele.parentElement;
          }
          if (ele == null || ele.tagName !== "LI") {
            return;
          }
          onclick(event, ele.getAttribute("index"));
        };
      }

      var close = function (event) {
        if (event && event.stopPropagation) {
          event.stopPropagation();
        }
        var body = document.querySelector("body");
        var msgEle = document.querySelector(".__showList");
        body.removeChild(msgEle);
      };
      document.querySelector(".__showList").onclick = close;
      return close;
    },
    getLocationBySelector(str) {
      var ele = document.querySelector(str);
      if (ele == null) return null;
      var body = document.querySelector("body");
      var result = {
        left: 0,
        top: 0,
        width: ele.offsetWidth,
        height: ele.offsetHeight,
      };
      while (ele !== body) {
        result.left += ele.offsetLeft;
        result.top += ele.offsetTop;
        ele = ele.parentElement;
      }
      return result;
    },
    curentTime() {
      var now = new Date();
      var year = now.getFullYear(); //年
      var month = now.getMonth() + 1; //月
      var day = now.getDate(); //日
      var hh = now.getHours(); //时
      var mm = now.getMinutes(); //分
      var ss = now.getSeconds(); //秒
      var clock = year + "-";
      if (month < 10) clock += "0";
      clock += month + "-";
      if (day < 10) clock += "0";
      clock += day + " ";
      if (hh < 10) clock += "0";
      clock += hh + ":";
      if (mm < 10) clock += "0";
      clock += mm + ":";
      if (ss < 10) clock += "0";
      clock += ss;
      return clock;
    },
    getCaseDate(type) {
      var now = new Date();
      var year;
      if (type == 0) {
        year = now.getFullYear() - 1;
      } else {
        year = now.getFullYear();
      }
      var month = now.getMonth() + 1;
      if (month < 10) {
        month = "0" + month;
      }
      var day = now.getDate();
      if (day < 10) {
        day = "0" + day;
      }

      return year + "-" + month + "-" + day;
    },
    getFileName() {
      var now = new Date();
      var year = now.getFullYear(); //年
      var month = now.getMonth() + 1; //月
      var day = now.getDate(); //日
      var hh = now.getHours(); //时
      var mm = now.getMinutes(); //分
      var ss = now.getSeconds(); //秒
      var clock = year;
      if (month < 10) clock += "0";
      clock += month;
      if (day < 10) clock += "0";
      clock += day + "_";
      if (hh < 10) clock += "0";
      clock += hh;
      if (mm < 10) clock += "0";
      clock += mm;
      if (ss < 10) clock += "0";
      clock += ss;
      return clock;
    },
    getCaseSource() {
      return [
        { value: "1", label: "执法检查发现" },
        { value: "2", label: "群众举报" },
        { value: "3", label: "电话投诉" },
        { value: "4", label: "上级机关交办" },
        { value: "5", label: "有关部门移送" },
        { value: "6", label: "媒体曝光" },
        { value: "9", label: "其他" },
      ];
    },
    convertCoachLevel() {
      return [
        { value: "11", label: "特大型高三级" },
        { value: "12", label: "特大型高二级" },
        { value: "13", label: "特大型高一级" },
        { value: "14", label: "特大型中级" },
        { value: "15", label: "特大型普通级" },
        { value: "21", label: "大型高三级" },
        { value: "22", label: "大型高二级" },
        { value: "23", label: "大型高一级" },
        { value: "24", label: "大型中级" },
        { value: "25", label: "大型普通级" },
        { value: "31", label: "中型高二级" },
        { value: "32", label: "中型高一级" },
        { value: "33", label: "中型中级" },
        { value: "34", label: "中型普通级" },
        { value: "41", label: "小型高二级" },
        { value: "42", label: "小型高一级" },
        { value: "43", label: "小型中级" },
        { value: "44", label: "小型普通级" },
        { value: "51", label: "乘用车高二级" },
        { value: "52", label: "乘用车高一级" },
        { value: "53", label: "乘用车中级" },
        { value: "54", label: "乘用车普通级" },
        { value: "0", label: "未评定" },
      ];
    },
    changeRpholidayState() {
      return [
        { value: "0", label: "区县" },
        { value: "1", label: "市" },
        { value: "2", label: "省" },
        { value: "3", label: "归档" },
      ];
    },
    uuid(len, radix) {
      var chars = "0123456789abcdefghijklmnopqrstuvwxyz".split("");
      var uuid = [],
        i;
      radix = radix || chars.length;
      if (len) {
        for (i = 0; i < len; i++) uuid[i] = chars[0 | (Math.random() * radix)];
      } else {
        var r;
        uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
        uuid[14] = "4";
        for (i = 0; i < 36; i++) {
          if (!uuid[i]) {
            r = 0 | (Math.random() * 16);
            uuid[i] = chars[i == 19 ? (r & 0x3) | 0x8 : r];
          }
        }
      }
      return uuid.join("");
    },
    fmtFileSize(bsize) {
      var size;
      if (bsize >= 1024 * 1024 * 1024) {
        size = (bsize / (1024 * 1024 * 1024)).toFixed(2) + "GB";
      } else if (bsize >= 1024 * 1024) {
        size = (bsize / (1024 * 1024)).toFixed(2) + "MB";
      } else if (bsize >= 1024) {
        size = (bsize / 1024).toFixed(2) + "KB";
      } else if (bsize < 1024) {
        if (bsize <= 0) {
          size = "0B";
        } else {
          size = bsize + "B";
        }
      }
      return size;
    },
    checkVecle(s) {
      var regu = (reg =
        /^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DABCEFGHJK]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/);

      var re = new RegExp(regu);
      if (re.test(s)) {
        return true;
      } else {
        return false;
      }
    },
    topBack() {
      api.closeFrame(api.frameName);
    },
    getData() {
      const functions = {
        analysisMyValue: this.analysisMyValue,
        changeVehicleLocus: this.changeVehicleLocus,
        pronameChangecode: this.pronameChangecode,
        procodeChangename: this.procodeChangename,
        pronameChangeVehi: this.pronameChangeVehi,
        vehiChangeProname: this.vehiChangeProname,
        changeOperstate: this.changeOperstate,
        changeOperowner: this.changeOperowner,
        changePlatecolor: this.changePlatecolor,
        changePlatecolorCode: this.changePlatecolorCode,
        changeTrans: this.changeTrans,
        changeVehType: this.changeVehType,
        getFueltype: this.getFueltype,
        lockmode: this.lockmode,
        isEntry: this.isEntry,
        vehiuse: this.vehiuse,
        certstype: this.certstype,
        certstatus: this.certstatus,
        ownercerttype: this.ownercerttype,
        getPracCertType: this.getPracCertType,
        getPracPersonnelType: this.getPracPersonnelType,
        getWorkType: this.getWorkType,
        getPracState: this.getPracState,
        getPracSource: this.getPracSource,
        getPracStatus: this.getPracStatus,
        getSex: this.getSex,
        getCreditStatus: this.getCreditStatus,
        getCreditLevel: this.getCreditLevel,
        vehiTechnologyLevel: this.vehiTechnologyLevel,
        vehiInspectState: this.vehiInspectState,
        vehiTechnologyState: this.vehiTechnologyState,
        vehiTechnologyres: this.vehiTechnologyres,
        changeCertType: this.changeCertType,
        changeLisenseType: this.changeLisenseType,
        getEducation: this.getEducation,
        changeDetectType: this.changeDetectType,
        changeDsType: this.changeDsType,
        getEvidenceType: this.getEvidenceType,
        subStr: this.subStr,
        subymd: this.subymd,
        changeEconomicType: this.changeEconomicType,
        getNationality: this.getNationality,
        getApplyTypeName: this.getApplyTypeName,
        getRecordStateName: this.getRecordStateName,
        getApprovalStateName: this.getApprovalStateName,
        getSignsTypeName: this.getSignsTypeName,
        getWhetherOrNot: this.getWhetherOrNot,
        getGPSResult: this.getGPSResult,
        toJSON: this.toJSON,
        showMsg: this.showMsg,
        showList: this.showList,
        getLocationBySelector: this.getLocationBySelector,
        curentTime: this.curentTime,
        getCaseDate: this.getCaseDate,
        getFileName: this.getFileName,
        getCaseSource: this.getCaseSource,
        convertCoachLevel: this.convertCoachLevel,
        changeRpholidayState: this.changeRpholidayState,
        uuid: this.uuid,
        fmtFileSize: this.fmtFileSize,
        checkVecle: this.checkVecle,
        topBack: this.topBack,
      };

      const func = functions[this.functionName];
      if (func) {
        this.data = func();
        console.log(`函数 ${this.functionName} 获取的数据:`, this.data); // 添加这行来输出数据
        this.$emit("data", this.data);
      } else {
        console.error(`未找到名为 ${this.functionName} 的函数`);
      }
    },
  },
};
</script>
